const express = require('express');
const UserModel = require('../models/user');
const { Message,MessageList } = require('../utils/message');

const router = express.Router();

router.get('/',(req,res,next)=>{
  UserModel.where('role').equals('buyer').count((err,count)=>{
    UserModel.where('role').equals('buyer').then(data=>{
        res.json(MessageList(200,'',data,0,0,count));
      })
  })
})

module.exports=router;
